package com.wangrui.mapper;

import com.wangrui.utils.Page;
import com.wangrui.dto.StudentInfo;
import com.wangrui.pojo.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 王锐
 * @since 2020-07-10
 */
public interface StudentMapper extends BaseMapper<Student> {
    @Select("SELECT student.*,class_grade.class_name as className,major.name as majorName,major.year,school.name as schoolName,school.address " +
            "from major,school,class_grade,student " +
            "WHERE student.sid=school.id and student.mid = major.id and student.cid = class_grade.id " +
            "and student.student_name like CONCAT(#{keyword}) " +
            "limit #{start},#{pageSize}")
    List<StudentInfo> getAllStudentInfo(Page<StudentInfo> page1);
}
